//
//  WJYBigPictureTableViewCell.m
//  WWLNetease
//
//  Created by dllo on 15/12/24.
//  Copyright © 2015年 Echo.Jobs. All rights reserved.
//

#import "WJYBigPictureTableViewCell.h"

@interface WJYBigPictureTableViewCell ()


@property (nonatomic, retain)NSString *imgsrc;
@property (nonatomic, retain)NSString *title;
@property (nonatomic, retain)NSString *url;


@property (nonatomic, retain)UIImageView *tempImageView;
@property (nonatomic, retain)UILabel *textL;
@property (nonatomic, retain)UIView *blackView;

@end


@implementation WJYBigPictureTableViewCell

- (void)setNewsM:(WJYNewsModel *)newsM{
    _newsM = newsM;
    [self getData];
    [self createViews];
}

#pragma mark- 处理数据
- (void)getData
{
    self.imgsrc = [self.newsM imgsrc];
    self.title = [self.newsM title];

}

- (void)createViews{
    
    self.tempImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 375 * KPropotionWidth, 200 * SIZE)];
        
    self.blackView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 375 * KPropotionWidth, 200 * SIZE)];
    self.blackView.backgroundColor = [UIColor blackColor];
    self.blackView.alpha = 0.3;
    [self.tempImageView addSubview:self.blackView];
    
    // 文字Label
    self.textL = [[UILabel alloc]initWithFrame:CGRectMake(10, 180 * SIZE - 5, (375 - 100) * KPropotionWidth, 20)];
    self.textL.text = self.title;
    self.textL.textColor = [UIColor whiteColor];
    self.textL.font = [UIFont systemFontOfSize:15];
    [self.tempImageView addSubview:self.textL];
        
    NSURL *url = [NSURL URLWithString:self.imgsrc];
    [self.tempImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeHoderImage.jpg"]];

    [self.contentView addSubview:self.tempImageView];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
